package com.ai.mall.service;

import com.ai.mall.entity.CartEntity;
import com.ai.mall.entity.UsersEntity;
import com.ai.mall.utils.PageUtils;
import com.ai.mall.utils.R;
import com.ai.mall.vo.req.AddCartProductInfoRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 购物车表
 *
 * @author easue
 * @email sunlightcs@gmail.com
 * @date 2025-01-21 14:40:34
 */
public interface CartService extends IService<CartEntity> {

    PageUtils queryPage(Map<String, Object> params);

    String addToCart(AddCartProductInfoRequest productInfo, UsersEntity userInfo);

    R removeFromCart(Integer productId, UsersEntity userInfo);

    R updateProductQuantity(Integer productId, Integer quantity, UsersEntity userInfo);

    List<CartEntity> getCartProducts(UsersEntity userInfo);
}

